home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / RLaB 1.18c / rlib / isreal.r < prev    next >
Encoding:
Text File  |  1995-02-25  |  478 b   |  20 lines  |  [TEXT/RLAB]

  1. //-------------------------------------------------------------------//
  2. // Synopsis:    Test if a matrix is ALL real.
  3.  
  4. // Usage:       isreal ( A )
  5.  
  6. // Description:
  7.  
  8. //      isreal tests its argument, A, and returns TRUE (1) if A's
  9. //      elements are all real, or FALSE (0) if any of A's elements are
  10. //      complex. 
  11.  
  12. // See Also: any
  13.  
  14. //-------------------------------------------------------------------//
  15.  
  16. isreal = function ( A )
  17. {
  18.   return all (all (imag (A) == 0));
  19. };
  20.